package com.study;

import java.util.Scanner;

public class ScannerDemo {
    public static void main(String[] args) {
        System.out.println("请输入一个整数");
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        System.out.println("整数:" + i);

        System.out.println("请输入一个小数");
        double d = sc.nextDouble();
        System.out.println("小数：" + d);

        System.out.println("请输入一个字符串");
        String str = sc.next();
        System.out.println("字符串（next）：" + str);

        System.out.println("请输入一个字符串");
        String str2 = sc.nextLine();
        System.out.println("字符串（nextLine）:" + str2);
        ;
    }
}
